{-# OPTIONS -Wall #-}

module Demo01 where

import DirectoryScript.Lib.Base
import DirectoryScript.Lib.HierSyntax
import qualified DirectoryScript.Lib.ResolvedSyntax as R
import DirectoryScript.Lib.TreeView
import DirectoryScript.Lib.WindowsParser

import Text.ZParse.DeltaParser


demo01 = do 
   ds <- directoriesFromFile "input/metrics.txt"
   either (error . id) (drawDirectories . makeHier) ds


demo02 = nameDelta p f1 f2
  where
    f1 =    "\\Hull WWTW\\Aeration\\SBR Blowers\\Blower MCP\\LOI" 
         ++ "\\Current\\HULL_SBR BLOWER MCP_V3_00.PBA"

    f2 =    "\\Hull WWTW\\Aeration\\SBR Blowers\\Blower MCP\\LOI"
         ++ "\\HULL_SBR BLOWER MCP_V3_00.PBA"

    p  = many1 tokenZ >> delete "Current" >> many tokenZ >> eof


nameDelta :: Parser Atom a -> FilePath -> FilePath -> Bool
nameDelta p old new = 
    either (const False) (const True) $ 
        runParserEither p (atoms old) (atoms new)


-- Do you want a trace of operations?
